Skip to content

Add VIX threshold-crossing backtest on QQQ - #3

Draft
ax3301 wants to merge 4 commits into
mainfrom
claude/vix-backtest-strategy-4diga8
Draft

Add VIX threshold-crossing backtest on QQQ#3
ax3301 wants to merge 4 commits into
mainfrom
claude/vix-backtest-strategy-4diga8

Conversation

@ax3301

@ax3301 ax3301 commented Aug 9, 2026

Copy link
Copy Markdown
Owner

What

Backtests a VIX-spike entry strategy on QQQ.

Signal (for each threshold T ∈ {17, 18, 19, 20, 21, 22}):

  • Previous trading day: VIX High < T
  • Current trading day: VIX High ≥ T
  • Action: buy QQQ at the current day's close

Measured: QQQ forward return over the next 5 / 20 / 60 trading days.

Reported per threshold × horizon: sample count, mean, median, win rate, best, worst — plus a QQQ buy-and-hold benchmark (average forward return over all trading days) and each cell's edge vs that benchmark.

Data

Yahoo Finance daily OHLC for ^VIX and QQQ, aligned on the common trading calendar (1999-03-10 → 2026-08-07, 6,896 trading days).

Files

  • vix_qqq_backtest.py — self-contained script (python3 vix_qqq_backtest.py)
  • vix_qqq_results.json — full output including every signal date

Headline finding

Buying QQQ when VIX High crosses up through a low threshold (17–20) roughly matches buy-and-hold; crossing up through a high threshold (22) is where forward returns turn negative in the short/medium term — i.e. the entry has essentially no timing edge, and gets worse as the trigger level rises.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JXFxuoYQvap2iq4EHbf9GW


Generated by Claude Code

claude added 4 commits August 9, 2026 20:05
Signal: VIX prior-day High < threshold and current-day High >= threshold;
buy QQQ at the close, measure 5/20/60-day forward returns for thresholds
17-22. Reports N, mean, median, win rate, best/worst per horizon and
compares against a QQQ buy-and-hold benchmark.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXFxuoYQvap2iq4EHbf9GW
…uy&hold

Strategies: 200d trend filter, Connors RSI2 mean reversion, dip-buy, and a
VIX-spike 10-day dip-buy. Reports total return, CAGR, vol, Sharpe, max
drawdown, exposure and trade frequency over full history and last 5 years.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXFxuoYQvap2iq4EHbf9GW
Enumerates 252 candidate QQQ timing strategies, tests market-timing alpha
(equity premium stripped out) with HAC/Newey-West t-stats, applies
Benjamini-Hochberg and Benjamini-Yekutieli FDR correction in-sample
(1999-2016), then confirms survivors out-of-sample (2017-2026). Zero
strategies pass both gates once beta is separated from skill.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXFxuoYQvap2iq4EHbf9GW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants